<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Mcrypt ciphers</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mcrypt.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mcrypt.examples.html">范例</a></div>
 <div class="up"><a href="book.mcrypt.html">Mcrypt</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mcrypt.ciphers" class="appendix">
 <h1>Mcrypt ciphers</h1>

 <p class="para">
  Here is a list of ciphers which are currently supported by the mcrypt
  extension.  For a complete list of supported ciphers, see the defines at
  the end of <var class="filename">mcrypt.h</var>. The general rule with the
  mcrypt-2.2.x API is that you can access the cipher from PHP with
  MCRYPT_ciphername. With the libmcrypt-2.4.x and libmcrypt-2.5.x API these constants also work,
  but it is possible to specify the name of the cipher as a string with a
  call to <span class="function"><a href="function.mcrypt-module-open.html" class="function">mcrypt_module_open()</a></span>.
  <ul class="itemizedlist">
   <li class="listitem"><span class="simpara">MCRYPT_3DES</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_ARCFOUR_IV (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_ARCFOUR (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_BLOWFISH</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_CAST_128</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_CAST_256</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_CRYPT</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_DES</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_DES_COMPAT (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_ENIGMA (libmcrypt &gt; 2.4.x only, alias for MCRYPT_CRYPT)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_GOST</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_IDEA (non-free)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_LOKI97 (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_MARS (libmcrypt &gt; 2.4.x only, non-free)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_PANAMA (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RIJNDAEL_128 (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RIJNDAEL_192 (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RIJNDAEL_256 (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC2</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC4 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC6 (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC6_128 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC6_192 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_RC6_256 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SAFER64</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SAFER128</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SAFERPLUS (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SERPENT(libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SERPENT_128 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SERPENT_192 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SERPENT_256 (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_SKIPJACK (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TEAN (libmcrypt 2.2.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_THREEWAY</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TRIPLEDES (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TWOFISH (for older mcrypt 2.x versions, or mcrypt &gt; 2.4.x )</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TWOFISH128 (TWOFISHxxx are available in newer 2.x versions, but not in the 2.4.x versions)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TWOFISH192</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_TWOFISH256</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_WAKE (libmcrypt &gt; 2.4.x only)</span></li>
   <li class="listitem"><span class="simpara">MCRYPT_XTEA (libmcrypt &gt; 2.4.x only)</span></li>
  </ul>
 </p>
 <p class="para">
  You must (in <strong><code>CFB</code></strong> and <strong><code>OFB</code></strong> mode)
  or can (in <strong><code>CBC</code></strong> mode) supply an
  initialization vector (IV) to the respective cipher function. The
  IV must be unique and must be the same when
  decrypting/encrypting. With data which is stored encrypted, you
  can take the output of a function of the index under which the
  data is stored (e.g.  the MD5 key of the filename).
  Alternatively, you can transmit the IV together with the encrypted
  data (see chapter 9.3 of Applied Cryptography by Schneier (ISBN 0-471-11709-9) for a
  discussion of this topic).
 </p>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mcrypt.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mcrypt.examples.html">范例</a></div>
 <div class="up"><a href="book.mcrypt.html">Mcrypt</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
